/*
    Copyright (c) 2010, Kozak Paweł (haango.mbox@gmail.com)
    All rights reserved.


    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
        * Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
        * Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
        * Neither the name of the <organization> nor the
        names of its contributors may be used to endorse or promote products
        derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY <copyright holder> ''AS IS'' AND ANY
    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

#ifndef LISTERRORS_H
#define LISTERRORS_H

#include <QString>

/**
  * Błąd polegający na braku odpowiedniego
  * sterownika do bazy danych.
  */
#define ERROR_DATABASE_DRIVER_NOT_EXISTS \
QString("Database: Driver is not exists")

/**
  * Bład polegający na niepoprawnym otwarciu
  * bazy danych.
  * 
  * @param _database - baza danych
  */
#define ERROR_DATABASE_WRONG_OPEN( _database ) \
"Database: " + database.lastError().text()

/**
  * Błąd polegający na źle przeprowadzonym
  * zapytaniu bazy danych.
  *
  * @param _query - obiekt zapytania
  */
#define ERROR_DATABASE_WRONG_QUERY( _query ) \
"Database: " + _query.lastError().text() + "\n" +\
"Query: " + _query.lastQuery()

/**
  * Błąd polegający na utracie spójności
  * danych w bazie danych.
  */
#define ERROR_DATABASE_LOSE_DATA_CONSISTENCY \
QString("Database: Lose data consistency ")

/**
  * Błąd polegający na nie uruchomieniu 
  * pliku o podobanej ścieżce docelowej
  *
  * @param _fileName - ścieżka docelowa pliku
  */
#define ERROR_PROGRAM_WRONG_EXECUTE( _fileName )\
"Program: Wrong with execute '" + _fileName + "'"

/**
  * Błąd polegający na wykonaniu przez
  * bazę danych zbędnego reconnectu.
  */
#define ERROR_DATABASE_BLOCKED_RECONNECT \
QString("Database: Blocked reconnect")

#endif // LISTERRORS_H
